import Vue from 'vue'
import Router from 'vue-router'
import PersonIndex from '@/pages/PersonIndex'
import PersonIndexWork from '@/pages/PersonIndex/Work'
import PersonIndexOnSale from '@/pages/PersonIndex/OnSale'
import PersonIndexArticle from '@/pages/PersonIndex/Article'
import PersonIndexActiveAction from '@/pages/PersonIndex/ActiveAction'
import PersonIndexSpreadtrum from '@/pages/PersonIndex/Spreadtrum'

import MoreIntro from '@/pages/MoreIntro'
import WorkGroup from '@/pages/WorkGroup/WorkGroup'
import WorkGroupWorks from '@/pages/WorkGroup/WorkGroupWorks'
import WorkGroupEdit from '@/pages/WorkGroup/WorkGroupEdit'
Vue.use(Router)

export default new Router({
  mode:'history',
  routes: [
    {
      path: '/:uid?',
      name: 'PersonIndex',
      component: PersonIndex,
      meta:{title:"个人官网"},
      children:[
        {
          path:"wechat_redirect",
          redirect:{name:'Work'}
        },
        {
          path:'Work',
          name:'Work',
          component:PersonIndexWork,
          meta:{title:'作品'}
        },
        {
          path:'OnSale',
          name:'OnSale',
          component:PersonIndexOnSale,
          meta:{title:'出售'}
        },
        {
          path:'Article',
          name:'Article',
          component:PersonIndexArticle,
          meta:{title:'文章'}
        },
        {
          path:'ActiveAction',
          name:'ActiveAction',
          component:PersonIndexActiveAction,
          meta:{title:'动态'}
        },
        {
          path:'Spreadtrum',
          name:'Spreadtrum',
          component:PersonIndexSpreadtrum,
          meta:{title:'展讯'}
        }
      ]
    },
    {
      path: '/MoreIntro',
      name: 'MoreIntro',
      component: MoreIntro,
      meta:{title:'简介'}
    },
    {
      path: '/WorkGroup',
      name:"WorkGroup",
      component: WorkGroup,
      meta:{title:'出售'}
    },
    {
      path: '/WorkGroupEdit/:groupId?',
      name:"WorkGroupEdit",
      component: WorkGroupEdit,
      meta:{title:'专辑编辑'}
    },
    {
      path: '/WorksGroupWorks/:groupId',
      name:"WorkGroupWorks",
      component: WorkGroupWorks,
      meta:{title:'专辑的作品'}
    },
    {
      path: '*',
      redirect:'/'
    }
  ]
})
